<?php
/**
 * File : UserPadGenerators.php
 * Created by Ludovic Reenaers
 * Created on  21 oct. 2010
 * lreenaers@hotmail.com
 */
class UserPadGenerator extends Generator{
	function setup(){
		$this->content = '<div id="userpad">';
		if($_SESSION["USER_BEAN"]->getProfile()->getLabel() == "anonymous"){
			$this->content.='<span><a href="'.$_SESSION['config']->controler.'?/login/show/">'.$this->translator->login.'</a></span> | <span><a href="'.$_SESSION['config']->controler.'?/user/add/">'.$this->translator->register.'</a></span>';
		}else{
			$this->content.='<b>'.strtolower($_SESSION['USER_BEAN']->getEmail()).'</b> |';
			$this->content .= '<span><a href="'.$_SESSION['config']->controler.'?/user/edit/">'.$this->translator->prefs.'</a></span> | <span><a href="'.$_SESSION['config']->controler.'?/user/logout/">'.$this->translator->logout.'</a></span>';
		}
		$this->content .='</div>';
	}
	function dump(){
		$this->setUp();
		return $this->content;
	}
}
?>